//
//  SiteModel.m
//  WGFGlobalHouses
//
//  Created by waiguofang on 15/4/22.
//  Copyright (c) 2015年 waiguofang. All rights reserved.
//




#import "HomeNewSiteCellModel.h"
#import "HomeNewSiteLabModel.h"


@implementation HomeNewSiteCellModel
@synthesize hourseId,title,countryName,stateName,cityName,address,openDate,openDateWithHour,hourseStauts,totalAmountCNY,totalAmountUSD,imgUrl,maxRate,labArr,currentDate;



-(instancetype)initWithDic:(NSDictionary *)dic;
{
    if (self = [super init])
    {
        self.hourseId = dic[@"housingId"];
        self.title = dic[@"title"];
        self.countryName = dic[@"countryName"];
        self.stateName = dic[@"stateName"];
        self.cityName = dic[@"cityName"];
        self.openDate = dic[@"openingDate"];
        self.currentDate = dic[@"currentTime"];
        self.hourseStauts = [dic[@"premisesStauts"] intValue];
        self.totalAmountUSD = [NSString stringWithFormat:@"%d",[dic[@"totalAmountUSD"]integerValue]];
        self.totalAmountCNY = dic[@"totalAmountCNY"];
        self.imgUrl = dic[@"thumb"];
        self.maxRate = dic[@"maxCommitionRate"];
        self.expiryDate = dic[@"expiryDate"];
        
        
        self.labArr = dic[@"premisesTags"];
        NSMutableArray *arrM = [NSMutableArray array];
        for (int i= 0;i < self.labArr.count; i ++)
        {
            NSString *str = [self.labArr objectAtIndex:i];
            HomeNewSiteLabModel *model = [HomeNewSiteLabModel siteWithStr:str];
            [arrM addObject:model];
            
        }
        self.labArr = arrM;

    }
    return self;
}

+(instancetype)siteModelWithDic:(NSDictionary *)dic;
{
    return [[self alloc]initWithDic:dic];
}

@end
